home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1997-04-23 | 2.1 KB | 84 lines | [TEXT/3PRM] |
- implementation module deltaSystem;
-
- from StdString import String;
- import StdReal, StdInt;
- import quickdraw, pointer;
- from windowAccess import ScrollBarWidth, TitleBarWidth, MenuBarWidth, WindowScreenBorder;
-
-
- UpKey :== '\036'; // Arrow up
- DownKey :== '\037'; // Arrow down
- LeftKey :== '\034'; // Arrow left
- RightKey :== '\035'; // Arrow right
- PgUpKey :== '\013'; // Page up
- PgDownKey :== '\014'; // Page down
- BeginKey :== '\001'; // Begin of text
- EndKey :== '\004'; // End of text
- BackSpKey :== '\010'; // Backspace
- DelKey :== '\177'; // Delete
- TabKey :== '\011'; // Tab
- ReturnKey :== '\015'; // Return
- EnterKey :== '\003'; // Enter
- EscapeKey :== '\033'; // Escape
- HelpKey :== '\005'; // Help
-
- DirSeparator :== ':'; // Separator between folder-
- // and filenames in a pathname
-
- ShiftOnly :== (True,False,False,False);
- OptionOnly :== (False,True,False,False);
- CommandOnly :== (False,False,True,False);
- ControlOnly :== (False,False,False,True);
-
- MMPerInch :== 25.4;
-
-
- HomePath :: !String -> String;
- HomePath fname = fname;
-
- ApplicationPath :: !String -> String;
- ApplicationPath fname = fname;
-
- MMToHorPixels :: !Real -> Int;
- MMToHorPixels mm = toInt ((mm * toReal horRes) / MMPerInch);
- where {
- (horRes,_) = LoadWord ScrnHResAddress NewToolbox;
- };
-
- MMToVerPixels :: !Real -> Int;
- MMToVerPixels mm = toInt ((mm * toReal vertRes) / MMPerInch);
- where {
- (vertRes,_) = LoadWord ScrnVResAddress NewToolbox;
- };
-
- InchToHorPixels :: !Real -> Int;
- InchToHorPixels inch = toInt (inch * toReal horRes);
- where {
- (horRes,_) = LoadWord ScrnHResAddress NewToolbox;
- };
-
- InchToVerPixels :: !Real -> Int;
- InchToVerPixels inch = toInt (inch * toReal vertRes);
- where {
- (vertRes,_) = LoadWord ScrnVResAddress NewToolbox;
- };
-
-
- MaxScrollWindowSize :: (!Int, !Int);
- MaxScrollWindowSize
- = (sR-ScrollBarWidth-dScrwW, sB-dScrwW-ScrollBarWidth-TitleBarWidth-MenuBarWidth);
- where {
- dScrwW = 2*WindowScreenBorder;
- (sL,sT, sR,sB, _) = QScreenRect NewToolbox;
- };
-
- MaxFixedWindowSize :: (!Int, !Int);
- MaxFixedWindowSize
- = (w+ScrollBarWidth, h+ScrollBarWidth);
- where {
- (w, h) = MaxScrollWindowSize;
- };